package com.celi.scs.system.controller;

import com.celi.cii.base.ResponseDTO;
import com.celi.scs.system.entity.LiduEntity;
import com.celi.scs.system.service.LiduService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("${url.prefix}/lidu")
public class LiduController {

    @Autowired
    private LiduService liduService;

    @GetMapping("/getLiduByDeviceId")
    public ResponseDTO<LiduEntity> getLiduByDeviceId(String deviceId) {
        return ResponseDTO.ok(liduService.getLiduByDeviceId(deviceId));
    }

    @GetMapping("/listLidu")
    public ResponseDTO<List<LiduEntity>> listLidu(String deviceId, String beginDate, String endDate) {
        return ResponseDTO.ok(liduService.listLidu(deviceId, beginDate, endDate));
    }

}
